<template>
	<view>
		<portrait :userId="userId" :token="token" :couId="couId" v-if="couId == '10090'"></portrait>
		<monetize :userId="userId" :token="token" :couId="couId" v-else-if="couId == '10101'"></monetize>
		<other :userId="userId" :token="token" :couId="couId" v-else></other>
	</view>
</template>
<script>
	const app = getApp();

	import {
		loginMobile,
	} from "@/api/user";
	import {
		mapGetters
	} from "vuex";

	import animationType from '@/utils/animationType.js'
	import portrait from './components/portrait.vue';
	import monetize from './components/monetize.vue';
	import other from './components/other.vue';
	export default {
		components: {
			portrait,
			monetize,
			other
		},
		data() {
			return {
				userId: '',
				token: '',
				couId: '',
				platform: uni.getSystemInfoSync().platform,
				statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
			}
		},
		onLoad() {
			let that = this;

			let locatiojUrl = window.location.href;

			//let locatiojUrl =
			//	'http://10.10.8.15:8080/qz/?phone=13012562102&token=1202bdc5effd1ecbbd447deec7a6f78b&userId=337538&couId=10090';

			that.userId = decodeURI(that.jqueryUrl(locatiojUrl).userId);
			that.token = decodeURI(that.jqueryUrl(locatiojUrl).token);
			that.couId = decodeURI(that.jqueryUrl(locatiojUrl).couId);
		},
		onPageScroll(res) {
			uni.$emit('pageScroll', res.scrollTop); // 通过全局事件传递滚动值
		},
		methods: {
			jqueryUrl(url) {
				let arr = url.split('?');
				let params = arr[1].split('&');
				let obj = {};
				for (let i = 0; i < params.length; i++) {
					let param = params[i].split('=');
					obj[param[0]] = param[1];
				}
				return obj;
			},
		}
	}
</script>

<style lang="scss" scoped>
	page,
	body {
		// height: 100%;
		// width: 100%;
		background-color: white;
	}
</style>